package com.atguigu.gmall.mq.controller;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.service.RabbitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author mgx
 * @version 1.0
 * @description: TODO
 * @date 2022-12-14 20:19
 */
@RestController
@RequestMapping("/mq")
@SuppressWarnings("all")
public class MqController {

    @Autowired
    private RabbitService rabbitService;

    /**
     * 测试发送消息
     * http://localhost:8282/mq/confirm
     * @return
     */
    @GetMapping("/confirm")
    public Result confirmTest() {
        rabbitService.sendMessage("exchange.confirm", "routingKey.confirm11", "你好，我是消息");
        return Result.ok();
    }
}
